from django.urls import re_path

from lab.credit.views import CreditScoreViewSet, CreditScoreWorkflowViewSet

urlpatterns = [
    re_path(r'^labs/credit$', CreditScoreViewSet.as_view({'get': 'list'}),
            name='获取信用分变动列表'),
    re_path(r'^labs/credit/apply$', CreditScoreViewSet.as_view({'post': 'create'}), name='提交信用分申请'),
    re_path(r'^labs/credit/transfer$', CreditScoreViewSet.as_view({'post': 'transfer_credit'}), name='转换信用分'),
    re_path(r'^labs/credit/(?P<id>\d+)$', CreditScoreViewSet.as_view({'get': 'retrieve'}),
            name='获取信用分详情'),
    re_path(r'^labs/credit/deduct$', CreditScoreWorkflowViewSet.as_view({"post": "deduct"}), name='扣除信用分'),
    re_path(r'^labs/credit/workflow$', CreditScoreWorkflowViewSet.as_view({"post": "approve"}), name='扣除信用分'),
]
